<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Make Controller Kit - Firmware API: Io</title>
<link href="mt_doxygen.css" rel="stylesheet" type="text/css" />
<link href="../resources/mt_doxytabs.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.header {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12pt;
	color: #222222;
}
-->
</style>
</head>

<body>
<table width="800" border="0">
    <tr>
      <td colspan="3">
        <form method="get" action="http://www.google.com/search">
          <div align="right">
            <input type="text"   name="q" size="25"
              maxlength="255" value="" />
            <input type="submit" value="Search" />
            <input type="hidden" name="sitesearch" value="makingthings.com/ref/firmware/html" />
          </div>
        </form>
       </td>
    </tr>
    <tr>
      <td><div align="center"><a href="http://www.makingthings.com">
				<img src="../resources/logo_brown_medium.png" alt="MakingThings"
									width="200" height="78" border="0" align="middle" longdesc="http://www.makingthings.com" /></a></div></td>
				<td><div align="center" class="header">
      		Make Controller Kit <br />
          Firmware API
      </div></td>
      <td><div align="center"><a href="http://www.makezine.com">
					<img src="../resources/make_logo.png" alt="MAKE Zine" 
										width="164" height="73" border="0" align="middle" longdesc="http://www.makezine.com" /></a></div></td>
    </tr>
</table>
</body>
</html>
<!-- Generated by Doxygen 1.5.4 -->
<script type="text/javascript">
<!--
function changeDisplayState (e){
  var num=this.id.replace(/[^[0-9]/g,'');
  var button=this.firstChild;
  var sectionDiv=document.getElementById('dynsection'+num);
  if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){
    sectionDiv.style.display='block';
    button.src='open.gif';
  }else{
    sectionDiv.style.display='none';
    button.src='closed.gif';
  }
}
function initDynSections(){
  var divs=document.getElementsByTagName('div');
  var sectionCounter=1;
  for(var i=0;i<divs.length-1;i++){
    if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){
      var header=divs[i];
      var section=divs[i+1];
      var button=header.firstChild;
      if (button!='IMG'){
        divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild);
        button=document.createElement('img');
        divs[i].insertBefore(button,divs[i].firstChild);
      }
      header.style.cursor='pointer';
      header.onclick=changeDisplayState;
      header.id='dynheader'+sectionCounter;
      button.src='closed.gif';
      section.id='dynsection'+sectionCounter;
      section.style.display='none';
      section.style.marginLeft='14px';
      sectionCounter++;
    }
  }
}
window.onload = initDynSections;
-->
</script>
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</span></a></li>
    <li><a href="classes.html"><span>Data&nbsp;Structures</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul>
</div>
<h1>Io<br>
<small>
[<a class="el" href="group___controller.html">Controller</a>]</small>
</h1>A mechanism to manage the 64 parallel IO lines on the controller.  
<a href="#_details">More...</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Modules</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___io_indices.html">IO Indices</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Indices (0-63) for each of the processor's IO lines. <br></td></tr>

<p>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___io_bits.html">IoBits</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Bit values (1 &lt;&lt; 0-63) for each of the processor's IO lines. <br></td></tr>

<p>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___io.html#g8a4becb6f3eeeb93849fa352633d40f2">Io_SetActive</a> (int index, int value)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Lock or release an IO line.  <a href="#g8a4becb6f3eeeb93849fa352633d40f2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___io.html#gf836954ad8c7001e80d3c043a3c23a75">Io_SetDirection</a> (int index, int output)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set whether an IO line is an output or an input.  <a href="#gf836954ad8c7001e80d3c043a3c23a75"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___io.html#g068a4b07b47f9c71d39d1f88ed50ba64">Io_GetDirection</a> (int index)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Read whether an IO line is an output or an input.  <a href="#g068a4b07b47f9c71d39d1f88ed50ba64"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___io.html#g31c976a85de4306c66be6b4c441d3892">Io_SetValue</a> (int index, char value)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Turn an IO line on or off.  <a href="#g31c976a85de4306c66be6b4c441d3892"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">char&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___io.html#gfdcf7332d0ae5b38d2a776fb6cc5ba7b">Io_GetValue</a> (int index)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Read whether an IO line, presumably set as an output, is on or off.  <a href="#gfdcf7332d0ae5b38d2a776fb6cc5ba7b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___io.html#g3ff4308d5768d83b4f2fe153576fc21e">Io_SetPullup</a> (int index, int enable)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the pullup resistor for an IO line on or off.  <a href="#g3ff4308d5768d83b4f2fe153576fc21e"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___io.html#gea14ac73a96c7c5ede5313532fcd35d7">Io_GetPullup</a> (int index)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Read whether the pullup resistor for an IO line on or off.  <a href="#gea14ac73a96c7c5ede5313532fcd35d7"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A mechanism to manage the 64 parallel IO lines on the controller. 
<p>
Control of the SAM7X's IO lines is more complex than most microcontrollers. All lines may be inputs or outputs, have pull-ups or not, have a glitch filter enabled or not, and so on. In addition all IO pins serve at least double and sometimes triple duty, being general IO lines and also being IO lines for one or more of the controller's many on-chip peripherals. All these functions can be controlled from the IO subsystem.<p>
This API can be used in two ways - either one line at a time or many at a time. Functions supporting the latter are suffixed with <b>Bits</b>. So the one-at-a-time mechanism for setting an IO to true is called Io_SetTrue(). It takes an index and the ones for setting a number of lines is Io_SetTrueBits( ).<p>
The pattern of use is as follows: prior to using an IO line, Call Io_Start() on it, the return value indicates if the start operation was successful. After this, call any of the other Io functions.<p>
<dl compact><dt><b><a class="el" href="todo.html#_todo000003">Todo:</a></b></dt><dd>Add glitch filter control </dd></dl>
<dl compact><dt><b><a class="el" href="todo.html#_todo000003">Todo:</a></b></dt><dd>Implement more bits-style functions </dd></dl>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="g068a4b07b47f9c71d39d1f88ed50ba64"></a><!-- doxytag: member="io.c::Io_GetDirection" ref="g068a4b07b47f9c71d39d1f88ed50ba64" args="(int index)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Io_GetDirection           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>index</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Read whether an IO line is an output or an input. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>index</em>&nbsp;</td><td>An int specifying which IO line. Use the appropriate entry from the <a class="el" href="group___io_indices.html">IO Indices</a> </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Non-zero if the pin is an output, 0 if it's an input.</dd></dl>
<dl class="user" compact><dt><b>Example</b></dt><dd><div class="fragment"><pre class="fragment">  <span class="comment">// Check whether IO 23 is an output or input</span>
  <span class="keywordflow">if</span>( <a class="code" href="group___io.html#g068a4b07b47f9c71d39d1f88ed50ba64" title="Read whether an IO line is an output or an input.">Io_GetDirection</a>( <a class="code" href="group___io_indices.html#g14901526d40a66b1b52aef0a7d4819ba" title="IO 23, Port A.">IO_PA23</a> ) )
  {
    <span class="comment">// then we're an output</span>
  }
  <span class="keywordflow">else</span>
  {
    <span class="comment">// we're an input</span>
  }
</pre></div> </dd></dl>

<p>Definition at line <a class="el" href="io_8c-source.html#l00300">300</a> of file <a class="el" href="io_8c-source.html">io.c</a>.</p>

</div>
</div><p>
<a class="anchor" name="gea14ac73a96c7c5ede5313532fcd35d7"></a><!-- doxytag: member="io.c::Io_GetPullup" ref="gea14ac73a96c7c5ede5313532fcd35d7" args="(int index)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Io_GetPullup           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>index</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Read whether the pullup resistor for an IO line on or off. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>index</em>&nbsp;</td><td>An int specifying which IO line. Use the appropriate entry from the <a class="el" href="group___io_indices.html">IO Indices</a> </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>CONTROLLER_OK (0) on success, otherwise non-zero.</dd></dl>
<dl class="user" compact><dt><b>Example</b></dt><dd><div class="fragment"><pre class="fragment">  <span class="comment">// Turn on the pullup for IO 17</span>
  <a class="code" href="group___io.html#gea14ac73a96c7c5ede5313532fcd35d7" title="Read whether the pullup resistor for an IO line on or off.">Io_GetPullup</a>( <a class="code" href="group___io_indices.html#g5c19735a0f7d4746c59e93d4da28212b" title="IO 17, Port A.">IO_PA17</a> );
</pre></div> </dd></dl>

<p>Definition at line <a class="el" href="io_8c-source.html#l00536">536</a> of file <a class="el" href="io_8c-source.html">io.c</a>.</p>

</div>
</div><p>
<a class="anchor" name="gfdcf7332d0ae5b38d2a776fb6cc5ba7b"></a><!-- doxytag: member="io.c::Io_GetValue" ref="gfdcf7332d0ae5b38d2a776fb6cc5ba7b" args="(int index)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char Io_GetValue           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>index</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Read whether an IO line, presumably set as an output, is on or off. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>index</em>&nbsp;</td><td>An int specifying which IO line. Use the appropriate entry from the <a class="el" href="group___io_indices.html">IO Indices</a> </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>CONTROLLER_OK (0) on success, otherwise non-zero.</dd></dl>
<dl class="user" compact><dt><b>Example</b></dt><dd><div class="fragment"><pre class="fragment">  <span class="comment">// Turn on IO 17</span>
  <a class="code" href="group___io.html#g31c976a85de4306c66be6b4c441d3892" title="Turn an IO line on or off.">Io_SetValue</a>( <a class="code" href="group___io_indices.html#g5c19735a0f7d4746c59e93d4da28212b" title="IO 17, Port A.">IO_PA17</a>, 1 );
</pre></div> </dd></dl>

<p>Definition at line <a class="el" href="io_8c-source.html#l00418">418</a> of file <a class="el" href="io_8c-source.html">io.c</a>.</p>

</div>
</div><p>
<a class="anchor" name="g8a4becb6f3eeeb93849fa352633d40f2"></a><!-- doxytag: member="io.c::Io_SetActive" ref="g8a4becb6f3eeeb93849fa352633d40f2" args="(int index, int value)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Io_SetActive           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>value</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Lock or release an IO line. 
<p>
When you set an IO line active, you're locking it so it can't be used by anything else. When you're done with it, you should always set it to inactive so it can be used by other things if needed. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>index</em>&nbsp;</td><td>An int specifying which IO line. Use the appropriate entry from the <a class="el" href="group___io_indices.html">IO Indices</a> </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>value</em>&nbsp;</td><td>Specify <b>true</b> to set it active, or <b>false</b> to set it to inactive.</td></tr>
  </table>
</dl>
<dl class="user" compact><dt><b>Example</b></dt><dd><div class="fragment"><pre class="fragment">  <span class="comment">// we want to use IO 18</span>
  <span class="keywordflow">if</span>( <a class="code" href="group___io.html#g8a4becb6f3eeeb93849fa352633d40f2" title="Lock or release an IO line.">Io_SetActive</a>( <a class="code" href="group___io_indices.html#g77ae10857dcba2d45f77615043443d45" title="IO 18, Port A.">IO_PA18</a>, <span class="keyword">true</span> ) == <a class="code" href="group___error.html#gaa42bc036fbba18487ae9a15cd1f2f94" title="All&amp;#39;s well here.">CONTROLLER_OK</a> )
  {
    DoThingsWithIO18( );
    <span class="comment">// now we're done - unlock it</span>
    <a class="code" href="group___io.html#g8a4becb6f3eeeb93849fa352633d40f2" title="Lock or release an IO line.">Io_SetActive</a>( <a class="code" href="group___io_indices.html#g77ae10857dcba2d45f77615043443d45" title="IO 18, Port A.">IO_PA18</a>, <span class="keyword">false</span> );
  }
</pre></div> </dd></dl>

<p>Definition at line <a class="el" href="io_8c-source.html#l00241">241</a> of file <a class="el" href="io_8c-source.html">io.c</a>.</p>

</div>
</div><p>
<a class="anchor" name="gf836954ad8c7001e80d3c043a3c23a75"></a><!-- doxytag: member="io.c::Io_SetDirection" ref="gf836954ad8c7001e80d3c043a3c23a75" args="(int index, int output)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Io_SetDirection           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>output</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Set whether an IO line is an output or an input. 
<p>
Use the IO_INPUT and IO_OUTPUT symbols to avoid confusion. <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>index</em>&nbsp;</td><td>An int specifying which IO line. Use the appropriate entry from the <a class="el" href="group___io_indices.html">IO Indices</a> </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>output</em>&nbsp;</td><td>Specify 1 for an output, or 0 for an input. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>CONTROLLER_OK (0) on success, non-zero otherwise.</dd></dl>
<dl class="user" compact><dt><b>Example</b></dt><dd><div class="fragment"><pre class="fragment">  <span class="comment">// Set io23 to an input</span>
  <span class="keywordflow">if</span>( <a class="code" href="group___io.html#gf836954ad8c7001e80d3c043a3c23a75" title="Set whether an IO line is an output or an input.">Io_SetDirection</a>( <a class="code" href="group___io_indices.html#g14901526d40a66b1b52aef0a7d4819ba" title="IO 23, Port A.">IO_PA23</a>, IO_INPUT ) == <a class="code" href="group___error.html#gaa42bc036fbba18487ae9a15cd1f2f94" title="All&amp;#39;s well here.">CONTROLLER_OK</a> )
  {
    <span class="comment">// success</span>
  }
</pre></div> </dd></dl>

<p>Definition at line <a class="el" href="io_8c-source.html#l00274">274</a> of file <a class="el" href="io_8c-source.html">io.c</a>.</p>

</div>
</div><p>
<a class="anchor" name="g3ff4308d5768d83b4f2fe153576fc21e"></a><!-- doxytag: member="io.c::Io_SetPullup" ref="g3ff4308d5768d83b4f2fe153576fc21e" args="(int index, int enable)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Io_SetPullup           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>enable</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Set the pullup resistor for an IO line on or off. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>index</em>&nbsp;</td><td>An int specifying which IO line. Use the appropriate entry from the <a class="el" href="group___io_indices.html">IO Indices</a> </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>enable</em>&nbsp;</td><td>Non-zero for on, 0 for off. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>CONTROLLER_OK (0) on success, otherwise non-zero.</dd></dl>
<dl class="user" compact><dt><b>Example</b></dt><dd><div class="fragment"><pre class="fragment">  <span class="comment">// Turn on the pullup for IO 17</span>
  <a class="code" href="group___io.html#g3ff4308d5768d83b4f2fe153576fc21e" title="Set the pullup resistor for an IO line on or off.">Io_SetPullup</a>( <a class="code" href="group___io_indices.html#g5c19735a0f7d4746c59e93d4da28212b" title="IO 17, Port A.">IO_PA17</a>, 1 );
</pre></div> </dd></dl>

<p>Definition at line <a class="el" href="io_8c-source.html#l00517">517</a> of file <a class="el" href="io_8c-source.html">io.c</a>.</p>

</div>
</div><p>
<a class="anchor" name="g31c976a85de4306c66be6b4c441d3892"></a><!-- doxytag: member="io.c::Io_SetValue" ref="g31c976a85de4306c66be6b4c441d3892" args="(int index, char value)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Io_SetValue           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&nbsp;</td>
          <td class="paramname"> <em>value</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Turn an IO line on or off. 
<p>
This IO should have already been set to be an output via <a class="el" href="group___io.html#gf836954ad8c7001e80d3c043a3c23a75" title="Set whether an IO line is an output or an input.">Io_SetDirection( )</a> <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>index</em>&nbsp;</td><td>An int specifying which IO line. Use the appropriate entry from the <a class="el" href="group___io_indices.html">IO Indices</a> </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>value</em>&nbsp;</td><td>Non-zero for on, 0 for off. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>CONTROLLER_OK (0) on success, otherwise non-zero.</dd></dl>
<dl class="user" compact><dt><b>Example</b></dt><dd><div class="fragment"><pre class="fragment">  <span class="comment">// Turn on IO 17</span>
  <a class="code" href="group___io.html#g31c976a85de4306c66be6b4c441d3892" title="Turn an IO line on or off.">Io_SetValue</a>( <a class="code" href="group___io_indices.html#g5c19735a0f7d4746c59e93d4da28212b" title="IO 17, Port A.">IO_PA17</a>, 1 );
</pre></div> </dd></dl>

<p>Definition at line <a class="el" href="io_8c-source.html#l00382">382</a> of file <a class="el" href="io_8c-source.html">io.c</a>.</p>

</div>
</div><p>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Make Controller Kit</title>
<style type="text/css">
<!--
.footer {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 9pt;
	color: #999999;
}
-->
</style>
</head>

<body>
<hr size="1">
<div>
  <p class="footer">The Make Controller Kit is an open source project maintained by <a href="http://www.makingthings.com">MakingThings</a>.<br />
    MakingThings code is released under the <a href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank">Apache 2.0 license</a>.<br />
    Bug tracker, development wiki and status can be found at <a href="http://dev.makingthings.com">http://dev.makingthings.com</a>.<br />
		This document was last updated on 5 Dec 2007.
</p>
</div>
<!-- Google Analytics Code -->
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-769030-1";
urchinTracker();
</script>
</body>
</html>
